package fr.alma.domo.music;

import java.util.ArrayList;
import java.util.List;

import fr.alma.domo.model.Context;
import fr.alma.domo.model.Property;
import fr.alma.domo.model.Resource;
import fr.alma.domo.music.rc.HP;

@SuppressWarnings("serial")
public class ClientContext extends Resource implements Context{
	
	public static final String RESOURCE_FAMILY = "fr.alma.domo.music.ClientContext";

	
	@Property(type=String.class)
	public static final String POSITION = "Client#position";	

	@Property(type=String.class)
	public static final String CLIENT_NAME = "Client#name";

	@Property(type=String.class)
	public static final String CLIENT_ID = "Client#id";

	@Property(type=Integer.class)
	public static final String PRIORITY = "Client#priority";
	
	/**
	 * La liste des HP occup� par le client
	 */
	@Property(type=List.class)
	public static final String HPs = "Client#HPs";
	
	public ClientContext(){
		super(RESOURCE_FAMILY);
		setAttribute(HPs, (List<?>)new ArrayList<HP>());
	}


	/**
	 * @return the id
	 */
	public String getId() {
		return getAttribute(CLIENT_ID,String.class);
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		setAttribute(CLIENT_ID,id);
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return getAttribute(CLIENT_NAME,String.class);
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		setAttribute(CLIENT_NAME,name);
	}

	/**
	 * @return the priority
	 */
	public int getPriority() {
		return getAttribute(PRIORITY,Integer.class);
	}

	/**
	 * @param priority the priority to set
	 */
	public void setPriority(int priority) {
		setAttribute(PRIORITY,(Integer)priority);
	}

	/**
	 * @return the currentPosition
	 */
	public String getCurrentPosition() {
		return getAttribute(POSITION,String.class);
	}

	/**
	 * @param currentPosition the currentPosition to set
	 */
	public void setCurrentPosition(String currentPosition) {
		setAttribute(POSITION,currentPosition);
	}
	
	/**
	 * La liste des hp occup� par le client
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<HP> getHPs(){
		return getAttribute(HPs,List.class);
	}
}
